package com.zc.study.designPattern.行为型设计模式.CommandPattern;

public class FunctionButton {
    private String name; //功能键名称
    private Command command; //维持一个抽象命令对象的引用

    public String getName() {
        return name;
    }

    public FunctionButton(String name) {
        this.name = name;
    }


    //为功能键注入命令
    public void setCommand(Command command) {
        this.command = command;
    }

    //发送请求
    public void onClick(){
        System.out.println("点击功能键");
        command.excute();
    }
}
